//
//  ZMClient.h
//  ZMUnderFrameWorkDemo
//
//  Created by chenzm on 2020/4/29.
//  Copyright © 2020 MAC. All rights reserved.
//

#import "ZMNetWorkingRequest.h"
#import "QuickPrompt.h"
#define kIsResResult(dic) [dic[@"status"] integerValue] == 200
#define kJumpLoginVC(dic) [dic[@"status"] integerValue] == 201
#define kJudgeCode(dic,code) [dic[@"status"] integerValue] == code
#define kUpdateImgMaxByte 1024*600


enum {
    PStyleNone=0,  ///< 没有提示
    PStyleSystem=1, ///< 系统弹出框提示样式
    PStyleMBProgress=2,///<MB黑色提示消失
    PStylePrompt=3,   ///<快速黑色提示
    
};
typedef NSInteger PromptStyle;

NS_ASSUME_NONNULL_BEGIN

@interface ZMClient : ZMNetWorkingRequest


/// 请求接口数量
@property (nonatomic,strong) NSMutableArray *requestMarr;



+(void)postWithUrl:(NSString*)url// 路径
            params:(NSMutableDictionary*)params// 参数
     isShowLoading:(BOOL)isLoading// 是否显示展示动态
            showVC:(UIViewController*)vc // 控制器
       promptStyle:(PromptStyle)style // 显示样式
         sureBlock:(void (^)(NSDictionary*dic,NSString *msg))block // 成功回调
       noDataBlock:(void (^)(NSDictionary*noDic,NSString *msg))noBlock // 其他状态回调
           failure:(void (^)(NSError *error,NSString *msg))fail; // 失败回调


+(void)getWithUrl:(NSString*)url// 路径
           params:(NSMutableDictionary*)params// 参数
    isShowLoading:(BOOL)isLoading// 是否显示展示动态
           showVC:(UIViewController*)vc// 控制器
      promptStyle:(PromptStyle)style// 显示样式
        sureBlock:(void (^)(NSDictionary*dic,NSString *msg))block// 成功回调
      noDataBlock:(void (^)(NSDictionary*noDic,NSString *msg))noBlock// 其他状态回调
          failure:(void (^)(NSError *error,NSString *msg))fail;// 失败回调

/// 单|多文件上传
+(void)updateFileWithUrl:(NSString*)url// 路径
                fileType:(NSInteger)fileType// 文件类型 0、图片 1、视频
                filesArr:(NSArray *)filesArr//文件
                  params:(NSMutableDictionary*)params// 参数
                 maxByte:(NSInteger)maxByte// 最大上传质量 单位kB 0、默认原件上传
           isShowLoading:(BOOL)isLoading// 是否显示展示动态
               toastFail:(BOOL)isToast// 请求失败吐丝
               sureBlock:(void (^)(NSDictionary*dic,NSString *msg))block// 成功回调
             noDataBlock:(void (^)(NSDictionary*noDic,NSString *msg))noBlock// 其他状态回调
                 failure:(void (^)(NSError *error,NSString *msg))fail;// 失败回调

/// 获取图片信息（阿里云图片）
+(void)getImgInfo:(NSString*)url
           params:(NSMutableDictionary*)params
    isShowLoading:(BOOL)isLoading
           showVC:(UIViewController*)vc
      promptStyle:(PromptStyle)style
        sureBlock:(void (^)(NSDictionary*dic,NSString *msg))block
      noDataBlock:(void (^)(NSDictionary*noDic,NSString *msg))noBlock
          failure:(void (^)(NSError *error,NSString *msg))fail;

/// 取消｜移除所有请求
+(void)zm_removeAllRequest;

/// 监听网络状态
+(void)zm_monitorNetworkStatus;


@end

NS_ASSUME_NONNULL_END
